﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace BlueLotus7.WeiboApiLibrary.Weibo.Contracts
{
    [DataContract]
    public class WeiboLocation
    {
        #region Property

        [DataMember]
        public decimal XValue
        {
            get;
            set;
        }

        [DataMember]
        public decimal YValue
        {
            get;
            set;
        }

        [DataMember]
        public string Caption
        {
            get;
            set;
        }

        #endregion

        public WeiboLocation()
        {
        }

        protected const string mapUrlFormat = "http://weibo.cn/service/place?xy={x}.{y}";
        public static string GenerateMapUrl(decimal x, decimal y)
        {
            return string.Format(mapUrlFormat, x.ToString(), y.ToString());
        }

    }
}
